<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Many to One - Join Table</title>
</head>
<body>
    <h3>Many to One - Join Table</h3>
    A many-to-one relationship can also be mapped using join table. Why would you like to do it the hard way when
    the usual many-to-one foreign key way is the easiest way to achieve it? Taking the example of Employee and Project,
    one possible reason could be that the database schema for these entities is already in place and you are not allowed
    to modify it to add foreign key column in Employee table. Another could be, the relationship is optional and your DBA
    doesn't approve having nullable foreign key column in Employee table.
    <p>The actual mapping is exactly same as already shown in <em>One To One - Join Table</em> topic. It is achieved
    by using <em>@JoinTable</em> annotation. Please refer to the source example and database table structure for the details.
    </p>
</body>
</html>
